using System;
using System.Configuration;
using System.Xml;

/*	-----------------------------------------------------------------------	
	Copyright:	umlungu consulting (Pty) ltd
	Author:		Alan Benington	
	Started:	2005-05-15	
	Status:		release	
	Version:	2.0.0
	Buidl:		20070524
	License:	GNU General Public License
	-----------------------------------------------------------------------	*/
	
/*	-----------------------------------------------------------------------	
	Development Notes:
	==================
	20070524:	Modification for .Net 2.0
	20070616:	Changed debug flag in configuration
	-----------------------------------------------------------------------	*/
	
namespace umlungu.engineX.webX {
	/// <summary>
	/// umlungu engineX web framework, default page class.
	/// </summary>
	public class adminX : pageX {
		#region Constants
		private const string CONFIG_ROOT = "WebX";
		private const string CONFIG_ELEM = "DebugX";
		#endregion

		#region Public methods
		/// <summary>Constructor</summary>
		public adminX() : base() { 
			x_config config = new x_config();
			string debugFlag = config.Value(String.Concat(CONFIG_ROOT, "/", CONFIG_ELEM, "/@site"));
			Debug = (debugFlag == "yes")? true : false; 
		}
		public adminX(bool debugFlag) : base(debugFlag) { 
		}
		/// <summary>
		/// Method description
		/// </summary>
		public void DoIt() {
			try {
				Initialise("thoughts");
				_Write();
			} 
			catch(exceptionX e)			{_WriteError(e);}
			catch(System.Exception e) 	{_WriteError(e);}
		}
		#endregion

		#region Protected methods
		/// <summary>
		/// Method description
		/// </summary>
		protected override void _WritePage() {
			Output("<a name='topofpage'></a><div id='header'>");
			_WriteLinks("x_header_xsl");
			Output("</div><div id='menu'>");
			_WriteLinks("x_menu_xsl");
			Output("</div><div id='content'>");
			_WriteContent();
			Output("</div>");
		}
		#endregion

		#region Private methods
		#endregion
	}
}
		
